package com.accenture.portal.dao.questionnaire.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.accenture.portal.dao.questionnaire.AnswerMapper;
import com.accenture.portal.model.questionnaire.Answer;
import com.accenture.portal.model.questionnaire.Questionnaire;

@Repository
public class AnswerMapperImpl implements AnswerMapper{

	@Autowired
	AnswerMapper answerMapper;
	
	@Override
	public Answer getAnswerById(Integer answerId) {
		return answerMapper.getAnswerById(answerId);
	}

	@Override
	public void addOptionAnswer(Answer answer) {
		answerMapper.addOptionAnswer(answer);
	}


	@Override
	public void editAnswer(Answer answer) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public List<Questionnaire> getAnswerSaved(Integer answerUser, Boolean answerType) {
//		List<Questionnaire> questionnaireList = answerMapper.getAnswerSaved(answerUser, answerType);
//		return questionnaireList;
		
		return answerMapper.getAnswerSaved(answerUser, answerType);
	}

	@Override
	public List<Questionnaire> getNewQuestionnaireByUser(Integer answerUser) {
		return answerMapper.getNewQuestionnaireByUser(answerUser);
	}

	@Override
	public void addTextAnswer(Answer answer) {
		answerMapper.addTextAnswer(answer);
	}

	@Override
	public Answer getAnswerTextByUserIdAndQuestionId(Integer answerUser, Integer answerQuestion) {
		return answerMapper.getAnswerTextByUserIdAndQuestionId(answerUser, answerQuestion);
	}

	@Override
	public Answer getAnswerByUserIdAndOptionId(Integer answerUser, Integer answerOption) {
		return answerMapper.getAnswerByUserIdAndOptionId(answerUser, answerOption);
	}

	@Override
	public void deleteAnswerByUserAndQuestionnaire(Integer answerUser, Integer answerQuestionnaire) {
		answerMapper.deleteAnswerByUserAndQuestionnaire(answerUser, answerQuestionnaire);
	}

	@Override
	public List<Answer> getSubmittedUserList(Integer answerQuestionnaire) {
		return answerMapper.getSubmittedUserList(answerQuestionnaire);
	}

	@Override
	public void deleteAnswerByQuestionnaire(Integer answerQuestionnaire) {
		answerMapper.deleteAnswerByQuestionnaire(answerQuestionnaire);
	}

}
